package com.learner.ucenter.controller.api;

import com.learner.ucenter.service.MsmService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author ice2020x
 * @Date: 2023/2/24
 * @Description: 发送短信验证码
 **/
@RestController
@RequestMapping("/api/ucenter/sms")
@Slf4j
public class MsmController {
    @Autowired
    private MsmService msmService;

    @GetMapping("/send/{phone}")
    public void sendMsm(HttpServletRequest request, @PathVariable("phone") String phone) {
        log.info("发送短信验证码的手机号是:{}", phone);
        msmService.sendMsg(request, phone);
    }
}
